<%@page import="com.lrf.freeshipping.bean.PageBean"%>
<%@page import="com.lrf.freeshipping.tool.LogTool"%>
<%@page import="com.lrf.freeshipping.jdbc.SQLConstant"%>
<%@page import="com.lrf.freeshipping.jdbc.JDBCOption"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>接口测试</title>
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
     <link rel="shortcut icon" type="image/x-icon" href="assets/image/favicon.ico" />

    <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/theme.css">
    <link rel="stylesheet" type="text/css" href="css/font-awesome.css">
    
    <script src="js/jquery-1.8.1.min.js" type="text/javascript"></script>

    <!-- Demo page code -->
    
    <style type="text/css">
        #line-chart {
            height:300px;
            width:800px;
            margin: 0px auto;
            margin-top: 1em;
        }
        .brand { font-family: georgia, serif; }
        .brand .first {
            color: #ccc;
            font-style: italic;
        }
        .brand .second {
            color: #fff;
            font-weight: bold;
        }
    </style>
</head>

  <body> 
    <!-- 引入头 -->
    <jsp:include page="head.jsp"/>

<!-- 检查是否是登录状态 -->
    <jsp:include page="check-sign-in.jsp"></jsp:include>
    
    <div class="container-fluid">
        
        <div class="row-fluid">
            <!-- 引入左菜单栏 -->
            <jsp:include page="left-menu.jsp" flush="true"></jsp:include>
            <script type="text/javascript" src="js/jquery.jqplot.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/graphDemo.js"></script>

<div class="span9">

<h1 class="page-title">接口测试</h1>

<div class="row-fluid">
    <div class="block">
        <p class="block-heading" data-toggle="collapse" data-target="#chart-container">按商品类型获取数据</p>
        <div id="chart-container" class="block-body collapse in">        
        <form action="InterfaceTest" method="post">
          <div class="btn-toolbar" style="float:right">
           <input type="hidden" name="type" value="1">
           <input type="submit" class="btn btn-primary" value="测试"/>
           <input type="reset" class="btn" value="清空"/>          
         </div>
         <br>
          <label>选择商品属性</label>
          <select name="tag" id="product-attribute" class="input-xlarge">
              <%
                 String []tags = {"Lastest","Women's Fashion","Men's Fashion","Accessories",
            		  "Jewelry&Watches","Beauty&Health","Beauty&Health","Wallet&Bags","Gadgets",
            		  "Underwear","Baby&KIds","Home Decor"}; 
                 for(int i=0;i<tags.length;i++){
              %>
              <option value ="<%=tags[i]%>"><%=tags[i]%></option>    
             <%}%>
          </select>
          
          <label>输入页码</label>
          <input type="text" class="input-xlarge" name="page">              
        </form>
        <%  String json = (String)request.getAttribute("result-json"); 
            if(json == null) json="";
            String interfaceUrl = (String)request.getAttribute("interface-url");           
        %>
        <label>生成的接口URL:&nbsp;&nbsp;
        <%if(interfaceUrl!=null){%>
           <a href="<%=interfaceUrl%>"><%=interfaceUrl%></a>
        <%}%>
        </label> 
        <label>测试结果</label>
        <textarea rows="10" style="width: 1000px" class="input-xlarge" >
          <%=json%>
        </textarea> 
        </div>
    </div>
</div>

     <div class="block">
        <p class="block-heading" data-toggle="collapse" data-target="#search-product">查询商品的接口</p>
        <div id="search-product" class="block-body collapse in">        
        <form action="InterfaceTest" method="post">
          <div class="btn-toolbar" style="float:right">
           <input type="hidden" name="type" value="2">
           <input type="submit" class="btn btn-primary" value="测试"/>
           <input type="reset" class="btn" value="清空"/>          
         </div>
         <br>
          <label>输入商品名</label>
          <input type="text" class="input-xlarge" name="product-name">
          <label>输入页码</label>
          <input type="text" class="input-xlarge" name="page">               
        </form> 
        <%  String resultSearch = (String)request.getAttribute("result-json-search");
            if(resultSearch ==null) resultSearch ="";
            String interfaceUrlSearch = (String)request.getAttribute("interface-url-search");
        %>       
        <label>生成的接口URL:&nbsp;&nbsp;
         <%if(interfaceUrlSearch!=null){%>
           <a href="<%=interfaceUrlSearch%>"><%=interfaceUrlSearch%></a>
         <%}%>
        </label> 
        <label>测试结果</label>
        <textarea rows="10" style="width: 1000px" class="input-xlarge" >
           <%=resultSearch%>
        </textarea> 
        </div>
    </div>
</div>
</div>





</div>

        
      <footer>
        <hr>
        
        <p class="pull-right">develop from <a href="#" title="iwenkeji" target="_blank">iwenkeji</a></p>
        
        
        <p>&copy; 2015 <a href="#">跨进电商</a></p>
    </footer>

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="js/bootstrap.js"></script>

  </body>
</html>